﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace viBook.Models
{
    public class Author
    {
        public int Id { set; get; }

        [Required(ErrorMessage = "AuthorName is required.")]
        [StringLength(25, ErrorMessage = "AuthorName is not longer than 25 characters")]
        public string AuthorName { set; get; }
        [NotMapped]
        public int NumberOfBook { get; set; }

        public virtual IEnumerable<Book> ListBook { set; get; }
    }
}